package com.hqyj.crmdemo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hqyj.crmdemo.entity.DevPlan;
import com.hqyj.crmdemo.entity.SaleChance;
import com.hqyj.crmdemo.mapper.DevPlanMapper;
import com.hqyj.crmdemo.service.IDevPlanService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 何万林
 * @since 2022-10-17
 */
@Service
public class DevPlanServiceImpl extends ServiceImpl<DevPlanMapper, DevPlan> implements IDevPlanService {
    @Autowired
    DevPlanMapper mapper;

    @Override
    public boolean addDevPlan(DevPlan devPlan) {
        int insert = mapper.insert(devPlan);
        return insert>0?true:false;
    }

    @Override
    public boolean deleteDevPlan(Integer saleId) {
        int i = mapper.deleteById(saleId);
        return i>0?true:false;
    }

    @Override
    public boolean updateDevPlan(DevPlan devPlan) {
        int i = mapper.updateById(devPlan);
        return i>0?true:false;

    }

    @Override
    public List<DevPlan> queryOne(QueryWrapper queryWrapper) {
        List<DevPlan> list = mapper.selectList(queryWrapper);
        return list;
    }

    @Override
    public List<DevPlan> queryAll() {
        List<DevPlan> devPlans = mapper.selectList(null);
        return devPlans;
    }
}
